Skip to content

Security challenge solution#1

Open
Mpurushotham wants to merge 3 commits into
NaturalCycles:mainfrom
Mpurushotham:security-challenge-solution
Open

Security challenge solution#1
Mpurushotham wants to merge 3 commits into
NaturalCycles:mainfrom
Mpurushotham:security-challenge-solution

Conversation

@Mpurushotham

@Mpurushotham Mpurushotham commented Jul 23, 2026

Copy link
Copy Markdown

Solution to the Security & Infrastructure Engineer challenge (Parts 1–5).

Contents

  • REPORT.md — written answers for Parts 1–4 (CORS analysis & prevention, XFF spoofing test + GCP/LB fix + rate-limiting recommendation, ELK-on-Cloud-Run log pipeline, and the attack-detection approach).
  • ARCHITECTURE.md — Mermaid diagrams (attack flow, hardened GCP target architecture, log pipeline, detection→Slack SOAR loop), key takeaways, a security-automation roadmap, and the tech stack.
  • slackbot/ — Part 5 Slack app: @slack/bolt in Socket Mode, node:sqlite persistence, interactive classification (Cyber attack / Infra instability / False positive) that updates the message in place and stores the event lifecycle.
  • app.js — real detection hook on /json-cors-origin/*: a credentialed cross-origin request (the Part 1 signature) fires the Slack alert automatically.
  • evidence/ — reproductions (CORS + XFF), OWASP ZAP baseline report + notes, and a Slack screenshot of resolved alerts.

Verified

Full chain proven end-to-end in the workspace: real attack request → detection in app.js → interactive Slack alert → human classification → chat.update to resolved state → persisted in SQLite with classifier + timestamp.

Notes

  • Part 5 backend runs standalone (slackbot/, Socket Mode — no public URL needed); secrets are read from an untracked .env (slackbot/.env.example shows the shape).
  • Parts 3 and 4 are theoretical per the brief.

… Slack response bot

Part 1 (CORS): reproduced the credentialed cross-origin data theft and documented
root cause, delivery vectors, and prevention (evidence/cors-attack-repro.md).

Part 2 (XFF spoofing): proved req.ip is attacker-controllable due to
trust proxy: true; documented GCP/LB hop-count fix and edge rate-limiting
recommendation (evidence/xff-spoof-repro.md).

Parts 3-4: ELK-on-Cloud-Run log pipeline design and hybrid detection approach
for the Part 1 attack (REPORT.md).

Part 5 (Slack): standalone Bolt Socket Mode bot (slackbot/) with node:sqlite
persistence; real detection hook in app.js posts an interactive alert on a
credentialed cross-origin request; classification updates the message in place
and persists state. Verified end-to-end in the workspace.

Evidence: OWASP ZAP baseline scan report + notes (evidence/).
Screenshot of #candidate-purushotham showing three bot alerts classified into
the discreet resolved state, corresponding to the persisted SQLite rows.
… stack

ARCHITECTURE.md: Mermaid diagrams for the CORS attack flow, hardened GCP target
architecture, ELK log pipeline, and the detection-to-Slack SOAR loop; plus key
takeaways, a security-automation maturity roadmap, and the tech stack. Linked
from REPORT.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant